﻿package  {
	
	import flash.display.MovieClip;
	import flash.events.MouseEvent;
	import flash.events.*;
	
	public class arrow extends MovieClip {
		var ismouseup:Boolean=false;
		var intp:vector2;
		public function arrow() {
			// constructor code
			this.addEventListener(MouseEvent.MOUSE_UP,mff);
			this.addEventListener(Event.ENTER_FRAME,frelisten);
		}
		public function init(vv:vector2)
		{
			intp=vv;
		}
		public function setlenght(a:Number)
		{
			tail.width=a;
		}
		public function mff(a:MouseEvent)
		{
			ismouseup=true;
		}
		public function frelisten(aaa:Event)
		{
			if(stage)
			{
			x=stage.mouseX;
			y=stage.mouseY;
			var tmpv22:vector2;
				tmpv22=new vector2(stage.mouseX,stage.mouseY);
				setlenght(tmpv22.sub(intp).length());
				rotation=intp.sub(tmpv22).getdegree();
			}
		}
	}
	
}
